package com.open.capacity.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitConfig {
    @Bean
    Queue mailQueue(){
        return new Queue("mailQ",true);
    }
    @Bean
    TopicExchange topicExchange(){
        return new TopicExchange("mailTopicExchange",true,false);
    }
    @Bean
    Binding binding(){
        return BindingBuilder.bind(mailQueue()).to(topicExchange()).with("send.#");
    }
}
